mob
	var
		isnew=0//Varible to show if they have logged in before.
		lx//Last X before they logged out.
		ly//Last Y
		lz//Last Z
	Login()
		.=..()
		if(src.isnew==1)
			src.loc=locate(usr.lx,usr.ly,usr.lz)
		if(src.isnew==0)
			src.isnew=1
			//src.loc=locate(1,1,1)
		.
	Logout()
		..()
/*	Stat()
		//That Stat() that runs sets the vars.
		usr.lx=usr.x
		usr.ly=usr.y
		usr.lz=usr.z
		statpanel("x,y,z=[usr.lx],[usr.ly],[usr.lz]")
		stat("Thanks for using this demo / library. Please give credit to the person who created the savefiles / saving. Also I would want some credit if you could be kind enough to put my name in. Thanks,")
		stat("-|- - Polaris8920 - -|-")  */
//*****************************************
//  Savefile system I found in the demos.
//  Please give credit to whoever made it.
//*****************************************

mob
	Logout()
		var/savefile/F = new(ckey)
		Write(F)
		del(src)
		return ..()

mob/Login()
	var/savefile/F = new(ckey)
	Read(F)
	return ..()